import { createApp } from 'vue'
import { createPinia } from 'pinia'
import router from './router/index'
import App from './App.vue'
import ElementPlus from 'element-plus'
import * as ElIcons from '@element-plus/icons-vue'

// 引入 svg icon 注册脚本
import 'virtual:svg-icons-register'
import 'element-plus/dist/index.css'

// 自定义库
import '@/assets/css/customStyle.css'
import '@/assets/css/commonUI.css'
import '@/assets/css/animate.css'
import '@/assets/style/index.scss'

const app = createApp(App)

// 循环注册所有图标
for (const name in ElIcons) {
	//name 为icon名称，也是组件名称。使用时：<Edit />，
	//也可以按需增加前缀或者后缀
	// eg: app.component(`eurake-name-${name}`,(Icons as any)[name])
	// 使用时：<eurake-name-Edit />
	// 当然你也可以写一个方法把首字母大写的图标名称改成小写等你想要的任意格式
	app.component(name, (ElIcons as any)[name])
}

app.use(createPinia())
app.use(router)
app.use(ElementPlus)
app.mount('#app')
